#ifndef __LIGHTMANAGER_H__
#define __LIGHTMANAGER_H__

#include "light.h"

#include <vector>

struct PointLightDistance {
public:
    Light* light;
    float distance;
    static bool Compare(PointLightDistance* p1, PointLightDistance* p2) {
        return p1->distance < p2->distance;
    }
};

class LightManager {
public:
    LightManager(void);
    ~LightManager(void);
    Vector4 GetAmbientLight() const;
    void SetAmbientLight(Vector4 val);
    void Add(Light* light);
    void Remove(Light* light);
    void UploadLights(Vector4 position);
private:
    Vector4 ambientLight;
    vector<Light*>* lights;
    void UploadDirectionalLights(vector<Light*>* directionalLights);
    void UploadPointLights(vector<PointLightDistance*>* pointLights);
};

#endif